


#include "Public.h"






// -------PP-

#define Out1_Port   GPIOA
#define Out1_Pin         GPIO_Pin_8

#define Out1_H   GPIO_WriteBit( Out1_Port, Out1_Pin,Bit_SET )
#define Out1_L   GPIO_WriteBit( Out1_Port, Out1_Pin,Bit_RESET)

#define Out2_Port   GPIOB
#define Out2_Pin         GPIO_Pin_15

#define Out2_H   GPIO_WriteBit( Out2_Port, Out2_Pin,Bit_SET )
#define Out2_L   GPIO_WriteBit( Out2_Port, Out2_Pin,Bit_RESET)

#define Out3_Port   GPIOB
#define Out3_Pin         GPIO_Pin_14

#define Out3_H   GPIO_WriteBit( Out3_Port, Out3_Pin,Bit_SET )
#define Out3_L   GPIO_WriteBit( Out3_Port, Out3_Pin,Bit_RESET)

#define Out4_Port   GPIOB
#define Out4_Pin         GPIO_Pin_13

#define Out4_H   GPIO_WriteBit( Out4_Port, Out4_Pin,Bit_SET )
#define Out4_L   GPIO_WriteBit( Out4_Port, Out4_Pin,Bit_RESET)


//==========================蜂鸣器==========================
#define BEEP_Port   GPIOB
#define BEEP_Pin         GPIO_Pin_12

#define BEEP_H   GPIO_WriteBit( BEEP_Port, BEEP_Pin,Bit_SET )
#define BEEP_L   GPIO_WriteBit( BEEP_Port, BEEP_Pin,Bit_RESET)



void BEEP (void)//蜂鸣器
{
  if(BEEP_EN!=0)
  {
    if((waning_numb>>0)&1!=0  || (waning_numb>>1)&1!=0
       || (waning_numb>>2)&1!=0|| (waning_numb>>3)&1!=0
         || (waning_numb>>4)&1!=0 || (waning_numb>>5)&1!=0
           || (waning_numb>>6)&1!=0|| (waning_numb>>7)&1!=0
             || (waning_numb>>9)&1!=0|| (waning_numb>>10)&1!=0             
               || (waning_numb>>11)&1!=0 )
    {
      if(BEEP_cnt<BEEP_on_time)
      {
        BEEP_H;
      }
      else if(BEEP_cnt<BEEP_off_time)
      {
        BEEP_L;
      }
      else
      {
        BEEP_cnt=0;
      }
    }
    else
    {
      BEEP_L;
    }
  }
  else
  {
      BEEP_L;     
  }
}



void output (void)
{

 u8 i;

//  
  if( gc.u8Scan_output_1ms_cnt<5)
  {  return; }      
  gc.u8Scan_output_1ms_cnt =0;


  i=0;
  if(out_ch1_val==0)
  {
    Out1_L;
  }  
  else
  {
    Out1_H;
  }   
  i++;
  if(out_ch2_val==0)
  {
    Out2_L;
  }  
  else
  {
    Out2_H;
  }   
  i++;
  if(out_ch3_val==0)
  {
    Out3_L;
  }  
  else
  {
    Out3_H;
  }   
  i++;
  if(out_ch4_val==0)
  {
    Out4_L;
  }  
  else
  {
    Out4_H;
  }   

  


}

